/**
 * 脚手架demo文件
 */
import request from '@/utils/request';
export function searchListWithPage(data) {
  return request({
    url: '/api/role-manage/searchListWithPage',
    method: 'get',
    params: data
  });
}

export function getMenuTree(data) {
  return request({
    url: '/api/role-manage/getMenuTree',
    method: 'get',
    params: data
  });
}

export function delRole(data) {
  return request({
    url: '/api/role-manage/delRole',
    method: 'post',
    params: data
  });
}

// 添加角色
export function addRole(data) {
  return request({
    url: '/api/role-manage/addRole',
    method: 'post',
    params: data
  });
}

// 修改角色
export function updateRole(data) {
  return request({
    url: '/api/role-manage/updateRole',
    method: 'post',
    params: data
  });
}

export function getRoleById(data) {
  return request({
    url: '/api/role-manage/getRoleById',
    method: 'get',
    params: data
  });
}

// 系统管理添加
export function addSystemUser(data) {
  return request({
    url: '/api/userInfo/addSystemUser',
    method: 'post',
    params: data
  });
}

// 系统管理查询
export function searchUserInfo(data) {
  return request({
    url: '/api/userInfo/searchUserInfo',
    method: 'post',
    data: data
  });
}

// 系统管理修改
export function updateSystemUser(data) {
  return request({
    url: '/api/userInfo/updateSystemUser',
    method: 'post',
    params: data
  });
}

export function getAllRoles(data) {
  return request({
    url: '/api/role-manage/getAllRoles',
    method: 'get',
    params: data
  });
}

export function userDisable(data) {
  return request({
    url: `/api/userInfo/userDisable/${data}`,
    method: 'put'
  });
}

export function userEnable(data) {
  return request({
    url: `/api/userInfo/userEnable/${data}`,
    method: 'put'
  });
}

